package com.us.jack.services.impl;

import java.util.List;

import com.us.jack.dao.IUserDAO;
import com.us.jack.pojo.PageModel;
import com.us.jack.pojo.User;
import com.us.jack.services.IUserServices;

public class UserServices implements IUserServices {
	private IUserDAO userDAO;

	public List<User> getUsersByKey(User user,PageModel<User> pageModel) throws RuntimeException {
		return userDAO.getUsersByKey(user,pageModel);
	}

	public IUserDAO getUserDAO() {
		return userDAO;
	}

	public void setUserDAO(IUserDAO userDAO) {
		this.userDAO = userDAO;
	}

	public void save(User user) throws RuntimeException {
		// TODO Auto-generated method stub
		this.userDAO.insert(user);
	}

	public int countUsers() throws RuntimeException {
		// TODO Auto-generated method stub
		return userDAO.countUsers();
	}

	public void modify(User user) throws RuntimeException {
		// TODO Auto-generated method stub
		userDAO.update(user);
	}

	public void remove(User user) {
		// TODO Auto-generated method stub
		userDAO.delete(user);
	}

}
